import { SingleInstance } from './singleInstance';


async function run() {
    const driver = SingleInstance.create_drive();

    await driver.get('https://login.anjuke.com/login/form');

    // 1. iframe webelement;
    const iframe = await driver.findElement({ css: 'iframe#iframeLoginIfm' })

    await driver.switchTo().frame(iframe);

    const phone = await driver.findElement({ id: "phoneIpt" });
    await phone.sendKeys("1234567")


    // 从iframe切换出来
    await driver.switchTo().defaultContent();
    // 切到房贷计算器
    const ele = await driver.findElement({ css: 'a[rel="nofollow"]' });
    await ele.click(); 
}

run();